var arrs = new Array(100 * 10000)

console.time('for')

for (let index = 0; index < arrs.length; index++) {
  
}

console.timeEnd('for')

console.time('forEach')

arrs.forEach((arr,index, origin)=>{

})

console.timeEnd('forEach')


function People(name){
  this.name = name
}

var people1 = new People('Lucy')
console.dir(people1)
console.log(people1 instanceof People)

function instanceofFunc (son,father){
  let sonVal = son.__proto__
  let fatherVal = father.prototype
  while(true) {
    if (sonVal == null) return false
    if (sonVal === fatherVal) return true
    sonVal = sonVal.__proto__
  } 
}

console.log(instanceofFunc(people1, People))